import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import {
  ArrayNotEmpty,
  IsArray,
  IsInt,
  IsOptional,
  IsString,
  Min,
  MinLength,
  ValidateNested,
} from 'class-validator';
import { PagerDto } from '~/common/dto/pager.dto';

export class PostDto {
  @ApiProperty({ description: '岗位名称' })
  @IsString()
  name: string;

  @ApiProperty({ description: '岗位编码' })
  @IsString()
  code: string;

  @ApiProperty({ description: '排序编号', required: false })
  @IsInt()
  @Min(0)
  @IsOptional()
  orderNo: number;
}

export class PostQueryDto extends PagerDto {
  @ApiProperty({ description: '岗位名称' })
  @IsString()
  @IsOptional()
  name?: string;
}
